'use strict';

Object.defineProperty(exports, "__esModule", {
    value: true
});
exports.urlEncode = undefined;

var _getUrlSearchParams = require('./getUrlSearchParams');

var _getUrlSearchParams2 = _interopRequireDefault(_getUrlSearchParams);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var urlEncode = exports.urlEncode = function urlEncode() {
    var map = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var search = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

    var newSearch = (0, _getUrlSearchParams2.default)(search);
    for (var k in map) {
        newSearch.set(k, map[k]);
    }
    return newSearch + '';
};
exports.default = urlEncode;